﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="Listall.aspx.cs" Inherits="lcs.Web.Admin.inventory.Listall" %>
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
         <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script src="../../My97DatePicker/WdatePicker.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtname.ClientID%>").autocomplete({
                 minLength: 2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName + item.proid, value: item.projectName };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<!--Title -->

            <!--Title end -->

            <!--Add  -->

            <!--Add end -->

            <!--Search -->
            <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                   
                    <td style="text-align:left;" >   <b>仓库：</b>                     
		<asp:DropDownList ID="ddlstore" runat="server">
        </asp:DropDownList>
                    <b>项目名：</b><asp:TextBox ID="txtname" runat="server" Width="102px"></asp:TextBox>
                        &nbsp;
                        <b>物料名：</b><asp:TextBox ID="txtm" runat="server" Width="102px"></asp:TextBox>
                         &nbsp;<b>采购订单号：</b><asp:TextBox ID="txtpurchaseid" runat="server"></asp:TextBox><b>供应商：</b><asp:TextBox ID="txtgys" runat="server"></asp:TextBox>
                        <b>入库时间：</b><asp:TextBox ID="txt_startTime" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" Width="82px"></asp:TextBox>
                        -<asp:TextBox ID="txt_endTime" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" Width="82px"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td class="tdbg">
                    </td>
                </tr>
                           
                <tr>
                   
                    <td style="text-align:left;" colspan="2" >   
            <asp:GridView ID="gridView" runat="server"  Width="1600px" BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None" 
                     OnRowDataBound="gridView_RowDataBound"
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" OnRowCreated="gridView_OnRowCreated" PageSize="20" ShowFooter="True">
                    <Columns>
                            
		<asp:BoundField DataField="spname" HeaderText="仓位" SortExpression="mid" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="sptname" HeaderText="仓位类型" SortExpression="spid" ItemStyle-HorizontalAlign="Center" Visible="False"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="sname" HeaderText="仓库" SortExpression="nums" ItemStyle-HorizontalAlign="Center"  > 
                            
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="status" HeaderText="仓位状态" Visible="False"  />
                        <asp:BoundField DataField="nums" HeaderText="数量"   />
                        <asp:BoundField DataField="unit" HeaderText="单位" />
                        <asp:BoundField DataField="unitPrice" HeaderText="单价" />
                        <asp:BoundField DataField="msum" HeaderText="小计" />
                        <asp:BoundField DataField="proid" HeaderText="项目编号" />
                        <asp:TemplateField HeaderText="项目名称">                            
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Decode(Eval("projectname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="material" HeaderText="物料名" />
                        <asp:BoundField DataField="mmodel" HeaderText="规格型号" Visible="False" />
                        <asp:BoundField DataField="usework" HeaderText="需用单位" Visible="False" />
                        <asp:BoundField DataField="equipmentManage" HeaderText="设备管理单位" />
                        <asp:BoundField DataField="projecttype" HeaderText="项目类型" />
                        <asp:BoundField DataField="remark" HeaderText="计划备注" />
                         <asp:BoundField DataField="purchaseid" HeaderText="采购订单号" SortExpression="purchaseid" ItemStyle-HorizontalAlign="Center"  > 
                            
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="supplier" HeaderText="供应商" />
                        <asp:BoundField DataField="intime" HeaderText="入库时间" />
                        </Columns>
                <PagerStyle CssClass="mypager" />
<RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>

                    </td>
                </tr>
                           
                <tr>
                   
                    <td style="text-align:left;" colspan="2" >   
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CurrentPageButtonPosition="Center"
                            PageSize="20" AlwaysShowFirstLastPageNumber="True" CustomInfoTextAlign="Left"
                    FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" NumericButtonCount="10"
                    PrevPageText="上一页" CssClass="paginator" CurrentPageButtonClass="" CustomInfoHTML="第 %CurrentPageIndex% 页|共 %PageCount% 页,%RecordCount%条记录 "
                    LayoutType="Table" ShowCustomInfoSection="Left" ShowNavigationToolTip="True"
                    ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextAfterPageIndexBox="页"
                    TextBeforePageIndexBox="转到第" onpagechanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>

                    </td>
                </tr>
                           
                <tr>
                    
                    <td align="left">
                        <asp:Button ID="btnout" runat="server" OnClick="btnout_Click" Text="导出" />
                    </td>
                    <td >                        
                    </td>
                </tr>
            </table>
</asp:Content>